All Questions
8 questions
2votes
2answers
252views
Replace Western Arabic numerals with Persian digits
I've written and used this code in my apps whenever needed to convert any Western Arabic numerals into Eastern Arabic (or better say, Persian/Farsi) numerals in any Persian text. It works fine as ...
3votes
1answer
192views
Splitting a long string based on its graphical presentation
I got a long string, let's call it Story. I fetch this story from a database so I don't know how long it is. I want to display this story in a view, but what if ...
2votes
1answer
2kviews
Filtering input characters for a numeric text field using logical operators
I did my code for "Bronze Challenge: Disallow Alphabetic characters" exercise in "iOS programming" book by Big Nerd Ranch (p.85). When I did the exercise I also changed code of func textField which ...
3votes
2answers
4kviews
Comparing strings, ignoring case, punctuation, and whitespace
I have built a search function that will compare strings regardless of punctuation and whitespace. It is case insensitive. Here is my current function: ...
5votes
3answers
3kviews
Determine if a string has all unique characters
I'm practicing algorithms (for future interviews) while learning about Big O notation and was wondering if there's a faster or more optimal way of writing an algorithm to see if a string has all ...
4votes
1answer
206views
URL percent encoding function
I wrote a custom URL encoding function and I'd like to run it past a few other experienced C developers. I have tested it on a few strings, and it has worked on all of them. This is to be run on ...
3votes
1answer
423views
Applying a currency symbol based on a tested string value
My conditional code here seems repetitive and long. Is there a better approach? I want to test for a string value in a NSDictionary object and then depending upon ...
5votes
2answers
376views
Rot47 an NSString Category
As a Java native, I am always a little worried when doing Objective-C because of memory leaks and pointers flying at my head... All comments are welcome on the ...